#include "TempUploadsTable.h"
#include "Ext\FilterQuery.h"
#include "Utility\Convertor.h"
#include "DatabaseException.h"

using namespace TCServer;
using namespace TCServer::Store;

namespace TCServer
{

	namespace Store
	{
        void TempUploadsTable::insert(const QString &path)
		{
			FilterQuery q;
			q.prepare(R"(

			INSERT INTO `tc`.`uploads`
			(`path`)
			VALUES
			(?);

			)");
			q.addBindValue(path);
			q.exec();
			return;
		}

		void TempUploadsTable::remove(const QString &path)
		{
			FilterQuery q;
			q.prepare(R"(

			DELETE FROM `tc`.`uploads`
			WHERE `path` = ?;

			)");

			q.addBindValue(path);
			q.exec();
		}
	}
}